package pl.lodz.p.browarex.threads;

import java.math.BigDecimal;

import javax.inject.Inject;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

import pl.lodz.p.browarex.dao.GenericDao;
import pl.lodz.p.browarex.model.ProductOrder;
import pl.lodz.p.browarex.ws.BeerEndpoint;
import pl.lodz.p.browarex.ws.model.ProductProdRequest;

@Component
public class ProductionTheard implements Runnable{

	@Autowired
	private BeerEndpoint be;

	public BeerEndpoint getBe() {
		return be;
	}

	public void setBe(BeerEndpoint be) {
		this.be = be;
	}

	public void run() {
		ProductProdRequest prq = new ProductProdRequest();
		prq.setActionType("EDIT");
		prq.setProductId("BEX1");
		prq.setBundle("Butelka");
		prq.setCapacity(500);
		prq.setDescription("Pyszne zimne piwo");
		prq.setName("Bronx");
		prq.setProductionId("P3");
		prq.setQuantity(400);
		prq.setType("Zwykle");
		prq.setVoltage(6);
		prq.setPrice(BigDecimal.valueOf((2.50)));
		 String xml = getBe().marshal(prq);
		 be.pushData(xml);
		 System.out.println("z watku");
	}

}
